Skip to content

Add conjunction parameter to natural_list - #316

Open
SAY-5 wants to merge 1 commit into
python-humanize:mainfrom
SAY-5:feat-natural-list-conjunction
Open

Add conjunction parameter to natural_list#316
SAY-5 wants to merge 1 commit into
python-humanize:mainfrom
SAY-5:feat-natural-list-conjunction

Conversation

@SAY-5

@SAY-5 SAY-5 commented May 18, 2026

Copy link
Copy Markdown

Fixes #214

Changes proposed in this pull request:

  • Add a keyword-only conjunction parameter to natural_list, defaulting to "and" so existing behaviour is unchanged.
  • This implements the design hugovk suggested in the issue, allowing any string such as "or" or "and also".
  • Add tests covering the new parameter alongside the default.

@codspeed-hq

codspeed-hq Bot commented May 19, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 15 untouched benchmarks


Comparing SAY-5:feat-natural-list-conjunction (0cedecf) with main (bde649f)

Open in CodSpeed

@codecov

codecov Bot commented May 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.55%. Comparing base (bde649f) to head (0cedecf).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #316   +/-   ##
=======================================
  Coverage   99.55%   99.55%           
=======================================
  Files          12       12           
  Lines         898      901    +3     
=======================================
+ Hits          894      897    +3     
  Misses          4        4           
Flag Coverage Δ
macos-latest 97.55% <100.00%> (+<0.01%) ⬆️
ubuntu-latest 97.55% <100.00%> (+<0.01%) ⬆️
windows-latest 95.67% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hugovk hugovk changed the title feat: add conjunction parameter to natural_list Add conjunction parameter to natural_list May 19, 2026
@hugovk hugovk added the changelog: Added For new features label May 19, 2026
@SAY-5

SAY-5 commented Aug 16, 2026

Copy link
Copy Markdown
Author

Any interest in this? It adds a conjunction argument to natural_list so callers can get "or" instead of the hardcoded "and".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: Added For new features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal for additional conjunction parameter in natural_list function

2 participants